-
-
Notifications
You must be signed in to change notification settings - Fork 39.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add leader_add_user callback #24266
base: develop
Are you sure you want to change the base?
Add leader_add_user callback #24266
Conversation
quantum/leader.c
Outdated
@@ -61,6 +63,9 @@ bool leader_sequence_add(uint16_t keycode) { | |||
leader_sequence[leader_sequence_size] = keycode; | |||
leader_sequence_size++; | |||
|
|||
if (leader_add_user()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might make sens to pass the keycode to the user function here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the response. I have added the keycode as a parameter to the leader_add_user callback and updated the documentation accordingly.
Thank you for your contribution! |
Needs review. |
Description
Added a user callback
bool leader_add_user()
for when keys are added to the leader key sequence. This callback can then be used in the user configuration to check keys as soon as they are added to the leader sequence. Whentrue
is returned, it will cause the leader sequence to end immediately, and false will continue the sequence as usual.This opens a couple of new possibilities for user configuration, including auto-terminating leader sequences - where when a valid sequence is checked the leader sequence will end immediately, removing the delay at the end of the sequence. Additionally, for keyboards with OLED screens, it can allow for a which-key style menu to appear during the leader sequence. Both of these features are implemented in my personal userspace.
Types of Changes
Issues Fixed or Closed by This PR
None, additional functionallity.
Checklist